package com.dsiab.manageService.controller;

import com.dsiab.manageService.common.ResponseMap;
import com.dsiab.manageService.entity.NoticeDto;
import com.dsiab.manageService.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system")
public class SystemController {

  @Autowired
  AdminService adminService;

  /**
   * 查询通知列表
   */
  @PostMapping("/getNotice")
  @PreAuthorize("hasRole('ROLE_admin')")
  public ResponseMap getNotice(@RequestBody NoticeDto noticeDto) {
    return ResponseMap.success(adminService.getNotice(noticeDto));
  }



}
